<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
<title>微博搜索</title>
<link rel="stylesheet" href="../../../common/css/search/card.css" />
<link rel="stylesheet" href="../../../common/css/search/global.css" />
<link rel="stylesheet"
	href="../../../common/css/search/layer_show_pic.css" />
<link rel="stylesheet" href="../../../common/css/search/module.css" />
<link rel="stylesheet" href="../../../common/css/search/page.css" />
<link rel="stylesheet" href="../../../common/css/search/video.css" />

<script type="text/javascript" src="../../../common/js/jQuery-3.3.1.js"></script>

<script type="text/javascript">
	$(document)
			.ready(
					function() {
						//搜索栏
						$(".s_button")
								.on(
										"click",
										function() {
											var searchText = $(".search_input")
													.val();
											console.log(searchText);
											window.location.href = "/searchlogic/weibo?searchText="
													+ searchText;
										})
						//搜索微博项
						$(".a_weibo")
								.on(
										"click",
										function() {
											var searchText = $(".search_input")
													.val();
											console.log(searchText);
											window.location.href = "/searchlogic/weibo?searchText="
													+ searchText;
										})

						//搜索找人项
						$(".a_find")
								.on(
										"click",
										function() {
											var searchText = $(".search_input")
													.val();
											console.log(searchText);
											window.location.href = "/searchlogic/find?searchText="
													+ searchText;
										})

						//搜索文章项
						$(".a_article")
								.on(
										"click",
										function() {
											var searchText = $(".search_input")
													.val();
											console.log(searchText);
											window.location.href = "/searchlogic/article?searchText="
													+ searchText;
										})

						//搜索话题项
						$(".a_topic")
								.on(
										"click",
										function() {
											var searchText = $(".search_input")
													.val();
											console.log(searchText);
											window.location.href = "/searchlogic/topic?searchText="
													+ searchText;
										})
					});
</script>
</head>

<body>

	<div class="m-main">
		<!--搜索-->
		<div class="m-search" id="pl_feedtop_top">
			<div class="logo">
				<a href="#"> <img
					src="../../../common/img/huzihan/search_logo.png" class="logo_img" />
				</a>
			</div>
			<div class="searchbox">
				<div class="search-input">
				<c:choose>
				<c:when test="${empty context }">
					<input class="search_input" type="text" maxlength="40"
						autocomplete="off" value="" />
				</c:when>
				<c:otherwise>
				<input class="search_input" type="text" maxlength="40"
						autocomplete="off" value="${context}" />
				</c:otherwise>
				</c:choose>
				</div>
				<button class="s-btn-b s_button">搜索</button>
			</div>
		</div>
		<!--/搜索-->
		<!--主导航-->
		<div class="m-main-nav s-mt28">
			<ul>
				<li><a class="cur a_weibo" href="javascript:;" title="微博">微博</a>
				</li>
				<li><a class="a_find" href="javascript:;" title="找人">找人</a></li>
				<li><a class="a_article" href="javascript:;" title="文章">文章</a>
				</li>

				<li><a class="a_topic" href="javascript:;" title="话题">话题</a></li>
			</ul>
		</div>
		<!--/主导航-->

		<div id="pl_feed_main">
			<!--内容-->
			<div class="m-wrap">
				<div class="m-con-l" id="pl_feedlist_index">
					<!--cate流-->
					<div>
						<!--微博card-->
						<!--card-wrap-->

						<c:choose>
							<c:when test="${empty weibolist}">
								<div class="card-wrap">
									<div class="card card-no-result s-pt20b40">
										<p>抱歉，未找到${context}相关结果。</p>
										<dl>
											<dt>建议:</dt>
											<dd>您可以尝试更换关键词，再次搜索。</dd>
											<dd>请尽量输入常用词</dd>
											<dd>请尽量使用简洁的关键词</dd>
										</dl>
									</div>
								</div>
							</c:when>
							<c:otherwise>
								<c:forEach items="${weibolist }" var="weibo" varStatus="sta">
								<c:if test="${sta.index<5 }">
									<div class="card-wrap">
										<div class="card">

											<div class="card-feed">
												<div class="avator">
													<a href="/weiboDetail/detail?WBid=${weibo.weiboId }" target="_blank"><img
														src="http://localhost:8082/serverpath/${weibo.user.userHeadpath}" /></a>
												</div>
												<!--微博内容-->
												<div class="content">
													<div class="info">
														<div>
															<a href="/common/showTaDeHomePage3?userId=${weibo.user.userId} " class="name" target="_blank">${weibo.user.userName}</a>
														</div>
													</div>
													<p class="txt">
														<a href="#">${weibo.topic.topicName }</a>
														${weibo.weiboContent }​
													</p>
													<!--card解析-->
													<div node-type="feed_list_media_prev">
														<div class="media media-piclist">

															<ul class="m4">

																<c:forEach items="${weibo.imgList }" var="img">
																	<c:choose>
																		<c:when test="${empty img.imgPath }">
																		</c:when>
																		<c:otherwise>
																			<li><img
																				src="http://localhost:8082/serverpath/${img.imgPath}"></li>
																		</c:otherwise>
																	</c:choose>
																</c:forEach>
															</ul>

														</div>
													</div>
													<!--<div node-type="feed_list_media_disp">
														</div>-->

													<!--/card解析-->
													<p class="from">
														<a href="#" target="_blank"> ${weibo.weiboTime } </a>
														&nbsp;来自 <a href="#" rel="nofollow">${weibo.weiboSource }</a>
													</p>
												</div>
												<!--/微博内容-->
											</div>
											<div class="card-act">
												<ul>
													<li><a href="/login/index">收藏</a></li>
													<li><a href="/login/index">转发${weibo.weiboForwardnum }</a>
													</li>
													<li><a href="/login/index">评论
															${weibo.weiboCommentnum }</a></li>
													<li><a href="/login/index">点赞数${weibo.weiboZannum }</a>
													</li>
												</ul>
											</div>
											<div node-type="feed_list_repeat"></div>

										</div>
									</div>
									</c:if>
								</c:forEach>
							</c:otherwise>
						</c:choose>


						<!--/card-wrap-->
						<!--/微博card-->
					</div>
					<!--/cate流-->
					<!--未登录提示-->
					<div class="m-hint">
						<i class="icon-warn icon-hint-s"></i> <a href="/login/index"
							action-type="login">立即登录</a>查看更多结果。还没有账号？赶紧 <a
							href="/regiest/reg">注册微博</a>
					</div>
					<!--未登录提示-->

				</div>

				<div class="m-con-r">
					<!--话题右侧流加载-->
					<!--热搜榜-->
					<div class="card-wrap" id="pl_band_index">
						<div class="card card-hotrank">
							<div class="card-head">
								<a href="/top/summary?cate=realtimehot" class="more s-fr">更多
									<i class="wbicon"></i>
								</a>
								<h4 class="title">热搜榜</h4>
							</div>
							<div class="card-content s-pg16">
								<ul>
									<c:forEach items="${topicdesc }" var="desc" varStatus="sta">
										<c:if test="${sta.index < 10}">
											<li><span class="num top">${sta.index+1}</span>
												<p>
													<span class="val">${desc.topicDiscussnum}</span> <a
														href="#">${desc.topicName }</a>
												</p></li>
										</c:if>
									</c:forEach>
								</ul>
							</div>
						</div>
					</div>
					<!--热搜榜-->

				</div>
			</div>
			<!--/内容-->
		</div>
	</div>
	<div class="m-footer">
		<div class="bottom">
			<div class="m-outlink">
				<div class="link">
					<a
						href="http://ir.weibo.com/phoenix.zhtml?c=253076&amp;p=irol-irhome"
						class="icon-wb" target="_blank" title="关于微博">关于微博</a> <a
						href="http://help.weibo.com/?refer=didao&amp;bottomnav=1&amp;wvr=5"
						target="_blank" title="微博帮助">微博帮助</a> <a
						href="http://help.weibo.com/newtopic/suggest?bottomnav=1&amp;wvr=5"
						target="_blank" title="意见反馈">意见反馈</a> <a
						href="http://open.weibo.com/?bottomnav=1&amp;wvr=5"
						target="_blank" title="开放平台">开放平台</a> <a
						href="http://hr.weibo.com/?bottomnav=1&amp;wvr=5" target="_blank"
						title="微博招聘">微博招聘</a> <a
						href="http://news.sina.com.cn/guide/?bottomnav=1&amp;wvr=5"
						target="_blank" title="新浪网导航">新浪网导航</a> <a
						href="http://service.account.weibo.com/?bottomnav=1&amp;wvr=5&amp;is_redirected=1"
						target="_blank" title="社区管理中心">社区管理中心</a> <a
						href="http://service.account.weibo.com/roles/gongyue?bottomnav=1&amp;wvr=5&amp;is_redirected=1"
						target="_blank" title="微博社区公约">微博社区公约</a>
				</div>
				<p class="copyright">
					Copyright © 2009-2019 WEIBO 北京微梦创科网络技术有限公司 <a
						href="https://weibo.com/aj/static/jww.html" target="_blank">京网文[2011]0398-130号</a>
					<a href="http://www.miibeian.gov.cn" target="_blank">京ICP备12002058号</a>
				</p>
			</div>
		</div>
	</div>
</body>

</html>